from gi.repository import Unity, Gio, GObject, Dbusmenu
import sys
import thread
import time
import argparse
from threading import Thread
import google
from launcher_pb2 import *


class GLoop(Thread):
	def __init__ (self):
		Thread.__init__(self)
		self.loop = loop = GObject.MainLoop()	
	def run(self):
		GObject.threads_init()
		self.loop.run()

def do(): print "hello!"
if __name__ == '__main__':
	
	appname = sys.argv[1]
	launcher = Unity.LauncherEntry.get_for_desktop_id(appname)
	thread = GLoop()
	thread.start()
	launcher.set_property("count-visible", True)
	launcher.set_property("count", 100)
	launcher.set_property('urgent', True)
	count = 0;
	while True:
		launcher.set_property("count", count)
		count += 1
		



